package com.jiawa.train.member.controller;

import com.jiawa.train.common.resp.CommonResp;
import com.jiawa.train.member.MemberRegisterReq;
import com.jiawa.train.member.service.MemberService;
import jakarta.annotation.Resource;
import jakarta.validation.Valid;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Author xxx
 * @className TestController
 * @description //TODO
 * @data 2025/3/9 13:19
 */
@RestController
@RequestMapping("member")
public class MemberController {

    @Resource
    private MemberService memberService;
    @GetMapping("/count")
    public int test(){
        return memberService.count();
    }

    @PostMapping ("/register")
    public CommonResp regitster(@Valid MemberRegisterReq registerReq){
        return memberService.regitster(registerReq);
    }


}
